/*
 * @Author: guandeshen 295570679@qq.com
 * @Date: 2024-05-11 21:09:19
 * @LastEditors: guandeshen 295570679@qq.com
 * @LastEditTime: 2024-08-27 16:24:36
 * @FilePath: /task-admin/src/views/log-book/config/content.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import LogAPI from "@/api/log";
import type { LogQuery } from "@/api/log/model";
import type { IContentConfig } from "@/components/PageContent/index.vue";
import i18n from "@/lang/index";

const contentConfig: IContentConfig<LogQuery> = {
  // tagList: [],
  // searchPlaceholder: i18n.global.t("common.searchPlaceholder"),
  hasDashData: false,
  pageName: i18n.global.t("route.logBookReport"),
  tableName: i18n.global.t("route.logBookReport"),
  table: {
    highlightCurrentRow: true,
  },
  indexAction: function (params) {
    return LogAPI.getPage(params);
  },
  pk: "id",
  toolbar: ["refresh"],
  cols: [
    // { type: "selection", width: 50, align: "center" },
    {
      label: i18n.global.t("common.operator"),
      align: "left",
      prop: "username",
      tooltip: true,
      minWidth: 140,
    },
    {
      label: i18n.global.t("common.apiUrl"),
      align: "left",
      prop: "url",
      tooltip: true,
      minWidth: 140,
    },
    {
      label: i18n.global.t("common.ip"),
      align: "left",
      prop: "ip",
      tooltip: true,
      minWidth: 140,
    },
    {
      label: i18n.global.t("common.operationTime"),
      align: "left",
      prop: "createtime",
      tooltip: true,
      minWidth: 140,
    },
    {
      label: i18n.global.t("common.operationDetails"),
      align: "left",
      prop: "content",
      tooltip: true,
      minWidth: 260,
    },
  ],
};

export default contentConfig;
